#include <iostream>
#include <unistd.h>
#include <sys/signal.h>
#include <stdlib.h>  // 包含 exit() 函数

int main()
{
    if (daemon(0, 0) == -1) {
        perror("daemon failed");
        return 1;
    }

    signal(SIGCHLD, SIG_IGN);

    while (1) {
        pid_t pid = fork();
        if (pid == -1) {
            perror("fork failed");
            sleep(61);
            continue;
        }

        if (pid == 0) {  
            execlp("curl", "curl", 
                   "https://maxue.blog.csdn.net/article/details/151792756?spm=1001.2014.3001.5502", 
                   (char*)NULL);
            
            perror("execlp failed");
            exit(1);
        }

        sleep(61); 
    }

    return 0;
}